﻿Imports System.ComponentModel

<Browsable(False)>
Public Class UpdateOption
    Private Shared mUpdateOptions As List(Of UpdateOptionDescriptions)
    Public Shared ReadOnly Property UpdateOptions As List(Of UpdateOptionDescriptions)
        Get
            Return mUpdateOptions
        End Get
    End Property
    Public Shared ReadOnly Property UpdateOptionDescription(UpdateOption As UpdateOptionID) As String
        Get
            Return (From x In mUpdateOptions Where x.OptionID = UpdateOption).First.OptionDescription
        End Get
    End Property
    Shared Sub LoadOptions()
        mUpdateOptions = New List(Of UpdateOptionDescriptions)
        mUpdateOptions.Add(New UpdateOptionDescriptions(UpdateOptionID.AlwaysUpdate, "Always Update"))
        mUpdateOptions.Add(New UpdateOptionDescriptions(UpdateOptionID.UpdateIfOlderThan, "Update if older than"))
        mUpdateOptions.Add(New UpdateOptionDescriptions(UpdateOptionID.UpdateIfMissing, "Update if missing"))
    End Sub
    Class UpdateOptionDescriptions
        Public Property OptionID As UpdateOptionID
        Public Property OptionDescription As String
        Sub New(NewOptionID As UpdateOptionID, NewDescription As String)
            OptionID = NewOptionID
            OptionDescription = NewDescription
        End Sub
    End Class
    Enum UpdateOptionID
        AlwaysUpdate = 1
        UpdateIfOlderThan = 2
        UpdateIfMissing = 3
    End Enum
End Class
